import {Admin, Res} from "../types";
import {error, ok, putRequest} from "../utils/myAxios.ts";


export async function updateAdminInfo(admin: Admin) : Res<Admin> {
    const r = await putRequest<Admin>('/admin/' + admin.id, admin);
    console.log('updateAdminInfo请求结果', r)
    if (r.id){
        return ok(r,'修改成功');
    }else{
        return error({})
    }
}